import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '../layout/Layout.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect:'/user',
        children: [
            {
                path: 'user',
                name: 'user',
                component: () =>import('../views/User'),
            },
            {
                path: 'book',
                name: 'book',
                component: () =>import('../views/Book'),
            },
            {
                path: 'news',
                name: 'news',
                component: () =>import('../views/News'),
            },
            {
                path: '/person',
                name: 'person',
                component: () => import("../views/Person")
            },
            {
                path: 'im',
                name: 'Im',
                component: () => import("../views/Im"),
            },
            {
                path: 'category',
                name: 'Category',
                component: () => import("../views/Category"),
            },
            {
                path: '/map',
                name: 'map',
                component: () => import("../views/Map")
            },
           /* {
                path: '/video',
                name: 'video',
                component: () => import("../views/Video")
            },*/
            {
                path: '/analysis',
                name: 'analysis',
                component: () => import("../views/Analysis")
            },
            {
                path: '/chat',
                name: 'chat',
                component: () => import("../views/Chat")
            },
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import("../views/Login")
    },
    {
        path: '/register',
        name: 'register',
        component: () => import("../views/register")
    },



]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
